package com.yoku.article.manager;

import com.yoku.article.dao.ArticleDao;
import com.yoku.article.dao.TagDao;
import com.yoku.article.model.Article;
import com.yoku.article.model.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * Desc:
 * Author: <a href="xiahj@terminus.io">xiahj</a>
 * Date: 2016/12/12
 */

@Component
public class ArticleManager {
    @Autowired
    private ArticleDao articleDao;

    @Autowired
    private TagDao tagDao;


    @Transactional
    public Boolean createArticleAndTag(Article article, Tag tag){
        articleDao.create(article);
        tagDao.create(tag);
        return true;
    }

}